package com.cdm.forum.dao;

import com.cdm.forum.model.Article;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ArticleMapper {
    int insert(Article record);

    int insertSelective(Article record);

    Article selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Article record);

    int updateByPrimaryKeyWithBLOBs(Article record);

    int updateByPrimaryKey(Article record);

    //查询所有帖子列表
   List<Article> selectAll();

   //根据板块id查询帖子列表
   List<Article> selectBoardById(@Param("boardId") Long boardId);

   //根据帖子id查询帖子信息
   Article selectDetailById(@Param("id") Long id);

   List<Article> selectByUserId(@Param("userId")Long userId);

}